﻿/*-----------------------------------------------
// File: DictHeroBlo.cs
// Description: 
// Author: Shaobing	492057342@qq.com
-----------------------------------------------*/
using System.Collections;
using System.Collections.Generic;

using Dict.DataModel;
namespace Dict.Blo
{
    public class DictHeroBlo
    {
        public static TableHero GetTableHero(string heroId) {
            return Dict.DictDataManager.Instance.tableHeroDao.GetById(heroId);
        }

        /// <summary>
        /// 不包含男女主角
        /// </summary>
        /// <returns></returns>
        public static List<TableHero> GetAllHeroTableHero() {
            List<TableHero> heroList = new List<TableHero>();
            foreach (var dict in Dict.DictDataManager.Instance.tableHeroDao.CacheList) {
                if (dict.heroClass == (int)HeroClass.Hero) {
                    heroList.Add(dict);
                }
            }
            return heroList;
        }

        public static List<TableBootHero> GetTableBootHeroByCamp(int camp) {
            var res = new List<TableBootHero>();
            foreach (var dict in Dict.DictDataManager.Instance.tableBootHeroDao.CacheList) {
                if (dict.Camp == camp)
                    res.Add(dict);
            }
            return res;
        }

        public static List<TableRecruitShowHero> GetTableRecruitShowHero(int space, int camp)
        {
            var res = new List<TableRecruitShowHero>();
            foreach (var dict in Dict.DictDataManager.Instance.tableRecruitShowHeroDao.CacheList)
            {
                if (dict.Camp == camp && dict.recruitSpace == space)
                {
                    res.Add(dict);
                }
            }
            return res;
        }

        public static TableHeroEmojiRes GetTableHeroEmojiRes(string id) {
            return Dict.DictDataManager.Instance.tableHeroEmojiResDao.GetById(id);
        }
        public static List<TableHeroEmojiRes> GetTableHeroEmojiResByModelName(string modelName) {
            return Dict.DictDataManager.Instance.tableHeroEmojiResDao.GetByOneIndex(modelName);
        }

        public static TableHeroEmojiRes GetTableHeroEmojiResByModelNameAndExpressType(string modelName, ModelExpressDetail expressType) {
            foreach (var dict in GetTableHeroEmojiResByModelName(modelName)) {
                if (dict.ExpressType == (int)expressType) {
                    return dict;
                }
            }
            return null;
        }

    }

}